<header role="banner" class="app-header">
  <span class="app-nav-auth">
    <% if current_user %>
        <%= link_to current_user.display_name, user_path(current_user) %>
        |
        <%= link_to t('nav.sign_out'), main_app.destroy_user_session_path,
                    method: :delete %>
    <% else %>
        <%= link_to t('nav.sign_in'), main_app.new_user_session_path %>
    <% end %>
  </span>
  <a class="app-nav-logo" href="/"><%= t 'brand.name' %></a>
  <div class="app-nav-theme">
    <span class="app-nav-text"><%= t 'nav.theme' %>:</span>
    <ul>
      <% themes.each do |(theme_key, theme_name)| %>
        <%= content_tag :li, class: ('app-current' if theme_key == current_theme), 'data-theme' => theme_key do -%>
          <% if theme_key == current_theme -%>
            <span class="app-nav-text"><%= theme_name %></span>
          <% else -%>
            <button type="button">
              <span class="app-nav-text"><%= theme_name %></span>
              <span class="app-nav-icon"><%= inline_svg_tag 'brightness.svg' %></span>
            </button>
          <% end -%>
        <% end -%>
      <% end %>
    </ul>
  </div>
</header>
